/**
 * 圣光牧师装备配置
 * 展示治疗型职业的装备配置模式
 */

import { EquipmentTemplate, ConfigCollection } from '../types/ConfigTypes';

/**
 * 圣光牧师武器配置
 */
export const holyPriestWeapons: EquipmentTemplate[] = [
    {
        id: "holy_priest_staff_001",
        name: "圣光法杖",
        sys: "神圣本质",
        type: "牧师",
        job: "圣光牧师",
        solt: "武器",
        icon: "staff_holy",
        emoji: "🦯",
        desc: "由圣光精华锻造的法杖，增强治疗和净化能力",
        source: "圣光神殿",
        
        quality: {
            min: 2, // 绿色起步
            max: 5, // 最高橙色
            weights: [30, 40, 25, 5] // 各品质权重分布（对应品质2,3,4,5）
        },
        
        baseAttributes: [
            {
                key: "魔法攻击",
                min: 18,
                max: 30,
                growthType: "linear",
                qualityMultiplier: 1.25
            },
            {
                key: "治疗加成",
                min: 20,
                max: 35,
                growthType: "exponential",
                qualityMultiplier: 1.3
            },
            {
                key: "魔法值",
                min: 50,
                max: 80,
                growthType: "linear"
            }
        ],
        
        skillPools: {
            inherent: [
                {
                    skillId: "HOLY_LIGHT",
                    reName: "圣光术",
                    desc: "对目标进行治疗，恢复大量生命值",
                    maxLevel: 10,
                    type: "active"
                }
            ],
            
            enchantable: [
                {
                    skill: {
                        skillId: "PURIFY",
                        reName: "净化",
                        desc: "移除目标身上的负面状态",
                        maxLevel: 5,
                        type: "active"
                    },
                    weight: 100,
                    maxCount: 1
                },
                {
                    skill: {
                        skillId: "BLESSING",
                        reName: "祝福",
                        desc: "为队友提供持续治疗效果",
                        maxLevel: 8,
                        type: "aura"
                    },
                    weight: 90,
                    conditions: {
                        minLevel: 3
                    }
                }
            ]
        },
        
        enabled: true,
        tags: ["神圣", "牧师", "武器", "治疗"]
    }
];

/**
 * 圣光牧师护甲配置
 */
export const holyPriestArmors: EquipmentTemplate[] = [
    {
        id: "holy_priest_robe_001",
        name: "圣光法袍",
        sys: "神圣本质",
        type: "牧师",
        job: "圣光牧师",
        solt: "护甲",
        icon: "robe_holy",
        emoji: "👘",
        desc: "由圣光丝线编织的法袍，提供防护和魔力恢复",
        source: "圣光神殿",
        
        quality: {
            min: 2,
            max: 5,
            weights: [35, 35, 25, 5] // 对应品质2,3,4,5
        },
        
        baseAttributes: [
            {
                key: "物理防御",
                min: 12,
                max: 20,
                growthType: "linear",
                qualityMultiplier: 1.1
            },
            {
                key: "魔法防御",
                min: 25,
                max: 40,
                growthType: "linear",
                qualityMultiplier: 1.2
            },
            {
                key: "魔力恢复",
                min: 8,
                max: 15,
                growthType: "exponential"
            }
        ],
        
        skillPools: {
            inherent: [
                {
                    skillId: "HOLY_PROTECTION",
                    reName: "圣光庇护",
                    desc: "受到攻击时有概率获得圣光护盾",
                    maxLevel: 8,
                    type: "passive"
                }
            ],
            
            enchantable: [
                {
                    skill: {
                        skillId: "MANA_SHIELD",
                        reName: "魔力护盾",
                        desc: "消耗魔法值抵消伤害",
                        maxLevel: 6,
                        type: "passive"
                    },
                    weight: 70
                }
            ]
        },
        
        enabled: true,
        tags: ["神圣", "牧师", "护甲", "防护"]
    }
];

/**
 * 圣光牧师装备配置集合
 */
export const HolypriestEquipmentCollection: ConfigCollection<EquipmentTemplate> = {
    version: "1.0.0",
    lastUpdated: Date.now(),
    data: [...holyPriestWeapons, ...holyPriestArmors],
    metadata: {
        author: "Game Design Team",
        description: "圣光牧师职业装备配置，专注治疗和防护",
        changelog: [
            "1.0.0 - 初始版本，包含基础武器和护甲配置"
        ]
    }
};

// 导出便于其他模块使用的查询函数
export const HolyPriestEquipmentHelper = {
    getWeapons: () => holyPriestWeapons,
    getArmors: () => holyPriestArmors,
    getByQuality: (minQuality: number, maxQuality: number) => 
        [...holyPriestWeapons, ...holyPriestArmors].filter(eq => 
            eq.quality.min <= maxQuality && eq.quality.max >= minQuality
        )
};
